
#include<string>
#include<stdint.h>
#include<sys/socket.h>
#include<netinet/ip.h>
#include<sys/types.h>
#include<unistd.h>
#include <fcntl.h>
class BaseSocket 
{
public:
    BaseSocket() = default;
    virtual ~BaseSocket() = default;

public:
    int32_t CreateSocket(const int32_t _af = AF_INET, const int32_t _type = SOCK_STREAM, const int32_t _protocol = IPPROTO_TCP) noexcept(true);
    void CloseSocket(int32_t _fd) noexcept(true);

    //设置socket模式(阻塞/非阻塞)
    void SetNonBlackSocket(int32_t _fd,bool _block);
    //获取Socket是否阻塞模式
    bool GetNonBlackModel(int32_t _fd);

    //设置读写缓冲区大小
    void SetRecvBuffSize(int32_t _fd,uint32_t _size);
    void SetSendBuffSize(int32_t _fd,uint32_t _size);

    //获取读取缓冲区大小
    int32_t GetRecvBuffSize(int32_t _fd);
    int32_t GetSendBuffSize(int32_t _fd);
};